<include file="Common:header"/>
<body>
	<!-- <div class="top-wrap" style="padding-top: 15px; padding-bottom: 15px;">
		<div class="top-tips-group">
			提示：使用微信文章插广告的步骤：进入微信,在微信中找到合适的文章,点右上角三个点,复制连接,进入<{$opt['site_name']}>粘贴打开。
		</div>
		<div class="title-bg">选择文章</div>
	</div> -->

	<include file="Common:cate_page"/>
	<div class="main-wrap" style="padding-top:50px;">
	<if condition = "!empty($article_list)">
		<foreach name="article_list" item="value">
			<a class="sel_art_btn" href="<{:U('Home/Article/article_detail_inside',array('aid'=>$value['id']))}>" >
				<div class="article-list-time"><{:date("Y年m月d日 H:i:s",$value['createtime'])}></div>
				<div class="article-list-content"><img src="__PUBLIC__/img/qeew.png" height="15px" width="15px" style="margin-right:3px;" ><{$value['title']}></div>
			</a>
			<div class="grey-hr"></div>
		</foreach>
	<else />
			<div class="grey-hr mg-b-15" style="text-align:center;font-size:16px;margin-top:10px">～暂无数据～</div>
	</if>
		<div id="loadding" style="text-align: center; display: none;"><img src="__PUBLIC__/js/layer/skin/default/loading-0.gif" /></div>
	</div>
	<input type="hidden" id="page" value="1">
	<include file="Common:menu"/>
</body>
</html>
<script>
$(function(){
	$(window).scroll(function () {
		if($(window).scrollTop()>=($(document).height()-$(window).height())){
			ajax_article();
		}
	});
});

//加载文章
function ajax_article(){
	var loadObj = $('#loadding');
	var page = $('#page').val();
	var cat_id = $('#cat_id').val();
	if(page == '-1'){
		return false;
	}
	loadObj.show();
	$.ajax({
		type: "POST",
		url: "<{:U('Home/Article/article_list_inside')}>",
		data: "page="+page+"&cat_id="+cat_id,
		dataType:'json',
		success: function(msg){
			if(msg.status == '1'){
				var html = '';
				for(var i  in  msg.data){
					html +='<a class="sel_art_btn" href="/index.php/Home/Article/article_detail_inside/aid/'+msg.data[i].id+'.html">';
					html +='<div class="article-list-time">'+msg.data[i].createtime+"</div>";
					html +='<div class="article-list-content"><img src="__PUBLIC__/img/qeew.png" height="15px" width="15px" style="margin-right:3px;" >'+msg.data[i].title+'</div></a><div class="grey-hr"></div>';
				}
				page = parseInt(page) + 1;
				$('#page').val(page);
				$('#loadding').before(html);
				loadObj.hide();
			}else{
				$('#page').val('-1');
				loadObj.hide();
			}
		}
	});
}

</script>